﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataObjects;
using DataAccess;
namespace BusinessLayer
{
    public class FilialBL
    {        
        FilialDAO _filialDAO = new FilialDAO();
        public FilialBL()
        {

        }

        public void Inserir(Filial _filial)
        {
            try
            {
                _filialDAO.Inserir(_filial);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }

        public void Alterar(Filial _filial)
        {
            try
            {
                _filialDAO.Alterar(_filial);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }

        public bool Deletar(int _filialId)
        {
            try
            {
                return _filialDAO.Deletar(_filialId);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }

        public List<Filial> Consultar(int _filialId)
        {
            try
            {
                return _filialDAO.Consultar(_filialId);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }

        public List<Filial> Consultar(string _filial)
        {
            try
            {
                return _filialDAO.Consultar(_filial);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }

        public List<Filial> Consultar()
        {
            try
            {
                return _filialDAO.Consultar();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
    }
}
